package com.softeem.work.w4;

public class Manager extends Emp{
    //奖金的属性
    private double bonus;

    public Manager() {
    }

    public Manager(int id, String name, double salary, double bonus) {
        super(id, name, salary);
        this.bonus = bonus;
    }

    public double getBonus() {
        return bonus;
    }

    public void setBonus(double bonus) {
        this.bonus = bonus;
    }

    @Override
    public void work(Object obj) {
        Manager manager = null;
        if(obj instanceof Manager){
            manager = (Manager)obj;
        }
        System.out.println("工号:" + manager.getId());
        System.out.println("姓名:" + manager.getName());
        System.out.println("工资:" + manager.getSalary());
        System.out.println("奖金："+ manager.getBonus());
    }
}
